const request = require('./request.js');
const API_URL = 'https://maoyanapi.w0824.com';
// 获取城市
exports.fetchWxLogin = function(code){
    let url=`${API_URL}/wxlogin`
    return request({
        method:"POST",
        url,
        data:{
            code
        }
    })
}

// 获取openid
exports.fetchGetOpenid = function(code){
    let url=`${API_URL}/getOpenid`
    return request({
        method:"POST",
        url,
        data:{
            code
        }
    })
}

// 下单接口
exports.fetchPayOrder = function(movieid,openid){
    let url=`${API_URL}/wxpay`
    return request({
        method:"POST",
        url,
        data:{
            movieid,openid
        }
    })
}

// 获取用户的订单
exports.fetchUserOrder = function(){
    let url=`${API_URL}/userOrder`
    return request({
        url
    })
}